function sum_from_1(n: int64): int64;
var
    s: int64;
begin
    s := n div 10 * 45;
    n := n mod 10;
    s := s + (1 + n) * n div 2;
    sum_from_1 := s;
end;

var
    n, m, s: int64;
    i: longint;
begin
    read(m, n);    
    writeln(sum_from_1(n) - sum_from_1(m - 1));
end.
